﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace THO7_Team8
{
    class Highlight
    {
        //Highlight.drawRectangleOnBitmap(newBitmap, 70, 70, 300, 120, Color.DeepPink);
        public static void drawRectangleOnBitmap(Bitmap inputImage, int xpos, int ypos, int xsize, int ysize, Color penColor){
            Graphics gBmp = Graphics.FromImage(inputImage);
            gBmp.CompositingMode = CompositingMode.SourceCopy;
            Pen _penColor = new Pen(Color.FromArgb(128, penColor.R, penColor.G, penColor.B), inputImage.Width / 200);
            gBmp.DrawRectangle(_penColor, xpos, ypos, xsize, ysize);
        }
        public static void drawLineOnBitmap(Bitmap inputImage, int xstart, int ystart, int xend, int yend, Color penColor)
        {
            Graphics gBmp = Graphics.FromImage(inputImage);
            gBmp.CompositingMode = CompositingMode.SourceCopy;
            Pen _penColor = new Pen(Color.FromArgb(128, penColor.R, penColor.G, penColor.B), inputImage.Width / 200);
            gBmp.DrawLine(_penColor, xstart, ystart, xend, yend);
        }   
        public static void drawTrapeziumOnBitmap(Bitmap inputImage, int upperleftx, int upperlefty, int upperrightx, int upperrighty, int lowerleftx, int lowerlefty, int lowerrightx, int lowerrighty, Color penColor){
            Graphics gBmp = Graphics.FromImage(inputImage);
            gBmp.CompositingMode = CompositingMode.SourceCopy;
            Pen _penColor = new Pen(Color.FromArgb(128, penColor.R, penColor.G, penColor.B), inputImage.Width / 200);
            gBmp.DrawLine(_penColor, upperleftx, upperlefty, upperrightx, upperrighty);
            gBmp.DrawLine(_penColor, upperrightx, upperrighty, lowerrightx, lowerrighty);
            gBmp.DrawLine(_penColor, lowerrightx, lowerrighty, lowerleftx, lowerlefty);
            gBmp.DrawLine(_penColor, lowerleftx, lowerlefty, upperleftx, upperlefty);
        }
    }
}
